Interpolation of video compression frames

ABSTRACT

Coding techniques for a video image compression system involve improving an image quality of a sequence of two or more bi-directionally predicted intermediate frames, where each of the frames includes multiple pixels. One method involves determining a brightness value of at least one pixel of each bi-directionally predicted intermediate frame in the sequence as an equal average of brightness values of pixels in non-bidirectionally predicted frames bracketing the sequence of bi-directionally predicted intermediate frames. The brightness values of the pixels in at least one of the non-bidirectionally predicted frames is converted from a non-linear representation.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of, and claims the benefit ofpriority to, U.S. patent application Ser. No. 12/986,228, entitled“Interpolation of Video Compression Frames,” which was filed on Jan. 7,2011, which is a continuation of U.S. patent application Ser. No.12/644,953, entitled “Video Image Compression Using Unequal Weights,”which was filed on Dec. 22, 2009, which is a continuation of U.S. patentapplication Ser. No. 12/567,161, now allowed, entitled “Interpolation ofVideo Compression Frames,” which was filed on Sep. 25, 2009, which is acontinuation of U.S. patent application Ser. No. 11/831,723, entitled“Interpolation of Video Compression Frames,” which was filed on Jul. 31,2007, and which is a divisional application of U.S. patent applicationSer. No. 10/187,395, entitled “Interpolation of Video CompressionFrames,” which was filed on Jun. 28, 2002, and issued as U.S. Pat. No.7,266,150 on Sep. 4, 2007. U.S. patent application Ser. No. 10/187,395is a continuation-in-part of U.S. patent application Ser. No.09/904,203, entitled “Interpolation of Video Compression Frames,” whichwas filed on Jul. 11, 2001, and which issued as U.S. Pat. No. 6,816,552on Nov. 9, 2004. The disclosures of all of the above applications areincorporated by reference in their entirety.

TECHNICAL FIELD

This invention relates to video compression, and more particularly toimproved interpolation of video compression frames in MPEG-like encodingand decoding systems.

BACKGROUND MPEG Video Compression

MPEG-2 and MPEG-4 are international video compression standards definingrespective video syntaxes that provides an efficient way to representimage sequences in the form of more compact coded data. The language ofthe coded bits is the “syntax.” For example, a few tokens can representan entire block of samples (e.g., 64 samples for MPEG-2). Both MPEGstandards also describe a decoding (reconstruction) process where thecoded bits are mapped from the compact representation into anapproximation of the original format of the image sequence. For example,a flag in the coded bitstream may signal whether the following bits areto be preceded with a prediction algorithm prior to being decoded with adiscrete cosine transform (DCT) algorithm. The algorithms comprising thedecoding process are regulated by the semantics defined by these MPEGstandards. This syntax can be applied to exploit common videocharacteristics such as spatial redundancy, temporal redundancy, uniformmotion, spatial masking, etc. In effect, these MPEG standards define aprogramming language as well as a data format. An MPEG decoder must beable to parse and decode an incoming data stream, but so long as thedata stream complies with the corresponding MPEG syntax, a wide varietyof possible data structures and compression techniques can be used(although technically this deviates from the standard since thesemantics are not conformant). It is also possible to carry the neededsemantics within an alternative syntax.

These MPEG standards use a variety of compression methods, includingintraframe and interframe methods. In most video scenes, the backgroundremains relatively stable while action takes place in the foreground.The background may move, but a great deal of the scene often isredundant. These MPEG standards start compression by creating areference frame called an “intra” frame or “I frame”. I frames arecompressed without reference to other frames and thus contain an entireframe of video information. I frames provide entry points into a databitstream for random access, but can only be moderately compressed.Typically, the data representing I frames is placed in the bitstreamevery 12 to 15 frames (although it is also useful in some circumstancesto use much wider spacing between I frames). Thereafter, since only asmall portion of the frames that fall between the reference I frames aredifferent from the bracketing I frames, only the image differences arecaptured, compressed, and stored. Two types of frames are used for suchdifferences—predicted frames (P frames), and bi-directional predicted(or interpolated) frames (B frames).

P frames generally are encoded with reference to a past frame (either anI frame or a previous P frame), and, in general, are used as a referencefor subsequent P frames. P frames receive a fairly high amount ofcompression. B frames provide the highest amount of compression butrequire both a past and a future reference frame in order to be encoded.Bi-directional frames are never used for reference frames in standardcompression technologies. P and I frames are “referenceable frames”because they can be referenced by P or B frames.

Macroblocks are regions of image pixels. For MPEG-2, a macroblock is a16×16 pixel grouping of four 8×8 DCT blocks, together with one motionvector for P frames, and one or two motion vectors for B frames.Macroblocks within P frames may be individually encoded using eitherintra-frame or inter-frame (predicted) coding. Macroblocks within Bframes may be individually encoded using intra-frame coding, forwardpredicted coding, backward predicted coding, or both forward andbackward (i.e., bi-directionally interpolated) predicted coding. Aslightly different but similar structure is used in MPEG-4 video coding.

After coding, an MPEG data bitstream comprises a sequence of I, P, and Bframes. A sequence may consist of almost any pattern of I, P, and Bframes (there are a few minor semantic restrictions on their placement).However, it is common in industrial practice to have a fixed framepattern (e.g., IBBPBBPBBPBBPBB).

Motion Vector Prediction

In MPEG-2 and MPEG-4 (and similar standards, such as H.263), use ofB-type (bi-directionally predicted) frames have proven to benefitcompression efficiency. Motion vectors for each macroblock of suchframes can be predicted by any one of the following three methods:

Mode 1: Predicted forward from the previous I or P frame (i.e., anon-bidirectionally predicted frame).

Mode 2: Predicted backward from the subsequent I or P frame.

Mode 3: Bi-directionally predicted from both the subsequent and previousI or P frame.

Mode 1 is identical to the forward prediction method used for P frames.Mode 2 is the same concept, except working backward from a subsequentframe. Mode 3 is an interpolative mode that combines information fromboth previous and subsequent frames. In addition to these three modes,MPEG-4 also supports a second interpolative motion vector predictionmode for B frames: direct mode prediction using the motion vector fromthe subsequent P frame, plus a delta value (if the motion vector fromthe co-located P macroblock is split into 8×8 mode—resulting in fourmotion vectors for the 16×16 macroblock—then the delta is applied to allfour independent motion vectors in the B frame). The subsequent Pframe's motion vector points at the previous P or I frame. A proportionis used to weight the motion vector from the subsequent P frame. Theproportion is the relative time position of the current B frame withrespect to the subsequent P and previous P (or I) frames.

FIG. 1 is a time line of frames and MPEG-4 direct mode motion vectors inaccordance with the prior art. The concept of MPEG-4 direct mode (mode4) is that the motion of a macroblock in each intervening B frame islikely to be near the motion that was used to code the same location inthe following P frame. A delta is used to make minor corrections to aproportional motion vector derived from the corresponding motion vector(MV) 103 for the subsequent P frame. Shown in FIG. 1 is the proportionalweighting given to the motion vectors 101, 102 for each intermediate Bframe 104 a, 104 b as a function of “time distance” between the previousP or I frame 105 and the next P frame 106. The motion vector 101, 102assigned to a corresponding intermediate B frame 104 a, 104 b is equalto the assigned weighting value (⅓ and ⅔, respectively) times the motionvector 103 for the next P frame, plus the delta value.

With MPEG-2, all prediction modes for B frames are tested in coding, andare compared to find the best prediction for each macroblock. If noprediction is good, then the macroblock is coded stand-alone as an “I”(for “intra”) macroblock. The coding mode is selected as the best modeamong forward (mode 1), backward (mode 2), and bi-directional (mode 3),or as intra coding. With MPEG-4, the intra coding choice is not allowed.Instead, direct mode becomes the fourth choice. Again, the best codingmode is chosen, based upon some best-match criteria. In the referenceMPEG-2 and MPEG-4 software encoders, the best match is determined usinga DC match (Sum of Absolute Difference, or “SAD”).

The number of successive B frames in a coded data bitstream isdetermined by the “M” parameter value in MPEG. M minus one is the numberof B frames between each P frame and the next P (or I). Thus, for M=3,there are two B frames between each P (or I) frame, as illustrated inFIG. 1. The main limitation in restricting the value of M, and thereforethe number of sequential B frames, is that the amount of motion changebetween P (or I) frames becomes large. Higher numbers of B frames meanlonger amounts of time between P (or I) frames. Thus, the efficiency andcoding range limitations of motion vectors create the ultimate limit onthe number of intermediate B frames.

It is also significant to note that P frames carry “change energy”forward with the moving picture stream, since each decoded P frame isused as the starting point to predict the next subsequent P frame. Bframes, however, are discarded after use. Thus, any bits used to createB frames are used only for that frame, and do not provide correctionsthat aid decoding of subsequent frames, unlike P frames.

SUMMARY

Aspects of the invention are directed to a method, system, and computerprograms for improving the image quality of one or more predicted framesin a video image compression system, where each frame comprises aplurality of pixels.

In one aspect, the invention includes determining the value of eachpixel of bi-directionally predicted frames as a weighted proportion ofcorresponding pixel values in non-bidirectionally predicted framesbracketing a sequence of bi-directionally predicted frames. In oneembodiment, the weighted proportion is a function of the distancebetween the bracketing non-bidirectionally predicted frames. In anotherembodiment, the weighted proportion is a blended function of thedistance between the bracketing non-bidirectionally predicted frames andan equal average of the bracketing non-bidirectionally predicted frames.

In another aspect of the invention, interpolation of pixel values isperformed on representations in a linear space, or in other optimizednon-linear spaces differing from an original non-linear representation.

Other aspects of the invention include systems, computer programs, andmethods encompassing:

-   -   A video image compression system having a sequence of        referenceable frames comprising picture regions, in which at        least one picture region of at least one predicted frame is        encoded by reference to two or more referenceable frames.    -   A video image compression system having a sequence of        referenceable frames comprising picture regions, in which at        least one picture region of at least one predicted frame is        encoded by reference to one or more referenceable frames in        display order, where at least one such referenceable frame is        not the previous referenceable frame nearest in display order to        the at least one predicted frame.    -   A video image compression system having a sequence of        referenceable frames comprising macroblocks, in which at least        one macroblock within at least one predicted frame is encoded by        interpolation from two or more referenceable frames.    -   A video image compression system having a sequence of        referenceable and bidirectional predicted frames comprising        picture regions, in which at least one picture region of at        least one bidirectional predicted frame is encoded to include        more than two motion vectors, each such motion vector        referencing a corresponding picture region in at least one        referenceable frame.    -   A video image compression system having a sequence of        referenceable frames comprising picture regions, in which at        least one picture region of at least one predicted frame is        encoded to include at least two motion vectors, each such motion        vector referencing a corresponding picture region in a        referenceable frame, where each such picture region of such at        least one predicted frame is encoded by interpolation from two        or more referenceable frames.    -   A video image compression system having a sequence of        referenceable and bidirectional predicted frames comprising        picture regions, in which at least one picture region of at        least one bidirectional predicted frame is encoded as an unequal        weighting of selected picture regions from two or more        referenceable frames.    -   A video image compression system having a sequence of        referenceable and bidirectional predicted frames comprising        picture regions, in which at least one picture region of at        least one bidirectional predicted frame is encoded by        interpolation from two or more referenceable frames, where at        least one of the two or more referenceable frames is spaced from        the bidirectional predicted frame by at least one intervening        referenceable frame in display order, and where such at least        one picture region is encoded as an unequal weighting of        selected picture regions of such at least two or more        referenceable frames.    -   A video image compression system having a sequence of        referenceable and bidirectional predicted frames comprising        picture regions, in which at least one picture region of at        least one bidirectional predicted frame is encoded by        interpolation from two or more referenceable frames, where at        least one of the two or more referenceable frames is spaced from        the bidirectional predicted frame by at least one intervening        subsequent referenceable frame in display order.    -   A video image compression system having a sequence of        referenceable and bidirectional predicted frames comprising        picture regions, in which at least one picture region of at        least one bidirectional predicted frame is encoded as an unequal        weighting from selected picture regions of two or more        referenceable frames.    -   A video image compression system having a sequence of predicted        and bidirectional predicted frames each comprising pixel values        arranged in macroblocks, wherein at least one macroblock within        a bidirectional predicted frame is determined using direct mode        prediction based on motion vectors from two or more predicted        frames.    -   A video image compression system having a sequence of        referenceable and bidirectional predicted frames each comprising        pixel values arranged in macroblocks, wherein at least one        macroblock within a bidirectional predicted frame is determined        using direct mode prediction based on motion vectors from one or        more predicted frames in display order, wherein at least one of        such one or more predicted frames is previous in display order        to the bidirectional predicted frame.    -   A video image compression system having a sequence of        referenceable and bidirectional predicted frames each comprising        pixel values arranged in macroblocks, wherein at least one        macroblock within a bidirectional predicted frame is determined        using direct mode prediction based on motion vectors from one or        more predicted frames, wherein at least one of such one or more        predicted frames is subsequent in display order to the        bidirectional predicted frame and spaced from the bidirectional        predicted frame by at least one intervening referenceable frame.    -   A video image compression system having a sequence of frames        comprising a plurality of picture regions having a DC value,        each such picture region comprising pixels each having an AC        pixel value, wherein at least one of the DC value and the AC        pixel values of at least one picture region of at least one        frame are determined as a weighted interpolation of        corresponding respective DC values and AC pixel values from at        least one other frame.    -   A video image compression system having a sequence of        referenceable frames comprising a plurality of picture regions        having a DC value, each such picture region comprising pixels        each having an AC pixel value, in which at least one of the DC        value and AC pixel values of at least one picture region of at        least one predicted frame are interpolated from corresponding        respective DC values and AC pixel values of two or more        referenceable frames.    -   Improving the image quality of a sequence of two or more        bidirectional predicted intermediate frames in a video image        compression system, each frame comprising a plurality picture        regions having a DC value, each such picture region comprising        pixels each having an AC pixel value, including at least one of        the following: determining the AC pixel values of each picture        region of a bidirectional predicted intermediate frame as a        first weighted proportion of corresponding AC pixel values in        referenceable frames bracketing the sequence of bidirectionally        predicted intermediate frames; and determining the DC value of        each picture region of such bidirectional predicted intermediate        frame as a second weighted proportion of corresponding DC values        in referenceable frames bracketing the sequence of bidirectional        predicted intermediate frames. A video image compression system        having a sequence of frames comprising a plurality of pixels        having an initial representation, in which the pixels of at        least one frame are interpolated from corresponding pixels of at        least two other frames, wherein such corresponding pixels of the        at least two other frames are interpolated while transformed to        a different representation, and the resulting interpolated        pixels are transformed back to the initial representation.    -   In a video image compression system having a sequence of        referenceable and bidirectional predicted frames, dynamically        determining a code pattern of such frames having a variable        number of bidirectional predicted frames, including: selecting        an initial sequence beginning with a referenceable frame, having        at least one immediately subsequent bidirectional predicted        frame, and ending in a referenceable frame; adding a        referenceable frame to the end of the initial sequence to create        a test sequence; evaluating the test sequence against a selected        evaluation criteria; for each satisfactory step of evaluating        the test sequence, inserting a bidirectional frame before the        added referenceable frame and repeating the step of evaluating;        and if evaluating the test sequence is unsatisfactory, then        accepting the prior test sequence as a current code pattern.    -   A video image compression system having a sequence of        referenceable frames spaced by at least one bidirectional        predicted frames, wherein the number of such bidirectional        predicted frames varies in such sequence, and wherein at least        one picture region of at least one such bidirectional predicted        frame is determined using an unequal weighting of pixel values        corresponding to at least two referenceable frames.    -   A video image compression system having a sequence of frames        encoded by a coder for decoding by a decoder, wherein at least        one picture region of at least one frame is based on weighted        interpolations of two or more other frames, such weighted        interpolations being based on at least one set of weights        available to the coder and a decoder, wherein a designation for        a selected one of such at least one set of weights is        communicated to a decoder from the coder to select one or more        currently active weights.    -   A video image compression system having a sequence of frames        encoded by a coder for decoding by a decoder, wherein at least        one picture region of at least one frame is based on weighted        interpolations of two or more other frames, such weighted        interpolations being based on at least one set of weights,        wherein at least one set of weights is downloaded to a decoder        and thereafter a designation for a selected one of such at least        one set of weights is communicated to a decoder from the coder        to select one or more currently active weights.    -   A video image compression system having a sequence of        referenceable frames encoded by a coder for decoding by a        decoder, wherein predicted frames in the sequence of        referenceable frames are transmitted by the encoder to the        decoder in a delivery order that differs from the display order        of such predicted frames after decoding.    -   A video image compression system having a sequence of        referenceable frames comprising pixels arranged in picture        regions, in which at least one picture region of at least one        predicted frame is encoded by reference to two or more        referenceable frames, wherein each such picture region is        determined using an unequal weighting of pixel values        corresponding to such two or more referenceable frames.    -   A video image compression system having a sequence of predicted,        bidirectional predicted, and intra frames each comprising        picture regions, wherein at least one filter selected from the        set of sharpening and softening filters is applied to at least        one picture region of a predicted or bidirectional predicted        frame during motion vector compensated prediction of such        predicted or bidirectional predicted frame.

The details of one or more embodiments of the invention are set forth inthe accompanying drawings and the description below. Other features,objects, and advantages of the invention will be apparent from thedescription and drawings, and from the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a time line of frames and MPEG-4 direct mode motion vectors inaccordance with the prior art.

FIG. 2 is a time line of frames and proportional pixel weighting valuesin accordance with this aspect of the invention.

FIG. 3 is a time line of frames and blended, proportional, and equalpixel weighting values in accordance with this aspect of the invention.

FIG. 4 is a flowchart showing an illustrative embodiment of theinvention as a method that may be computer implemented.

FIG. 5 is a diagram showing an example of multiple previous referencesby a current P frame to two prior P frames, and to a prior I frame.

FIG. 6A is a diagram of a typical prior art MPEG-2 coding pattern,showing a constant number of B frames between bracketing I frames and/orP frames.

FIG. 6B is a diagram of a theoretically possible prior art MPEG-4 videocoding pattern, showing a varying number of B frames between bracketingI frames and/or P frames, as well as a varying distance between Iframes.

FIG. 7 is a diagram of code patterns.

FIG. 8 is a flowchart showing one embodiment of an interpolation methodwith DC interpolation being distinct from AC interpolation.

FIG. 9 is a flowchart showing one embodiment of a method forinterpolation of luminance pixels using an alternative representation.

FIG. 10 is a flowchart showing one embodiment of a method forinterpolation of chroma pixels using an alternative representation.

FIG. 11 is a diagram showing unique motion vector region sizes for eachof two P frames.

FIG. 12 is a diagram showing a sequence of P and B frames withinterpolation weights for the B frames determined as a function ofdistance from a 2-away subsequent P frame that references a 1-awaysubsequent P frame.

FIG. 13 is a diagram showing a sequence of P and B frames withinterpolation weights for the B frames determined as a function ofdistance from a 1-away subsequent P frame that references a 2-awayprevious P frame.

FIG. 14 is a diagram showing a sequence of P and B frames in which asubsequent P frame has multiple motion vectors referencing prior Pframes.

FIG. 15 is a diagram showing a sequence of P and B frames in which anearest subsequent P frame has a motion vector referencing a prior Pframe, and a next nearest subsequent P frame has multiple motion vectorsreferencing prior P frames.

FIG. 16 is a diagram showing a sequence of P and B frames in which anearest previous P frame has a motion vector referencing a prior Pframe.

FIG. 17 is a diagram showing a sequence of P and B frames in which anearest previous P frame has two motion vectors referencing prior Pframes.

FIG. 18 is a diagram showing a sequence of P and B frames in which anearest previous P frame has a motion vector referencing a prior Pframe.

FIG. 19 is a frame sequence showing the case of three P frames P1, P2,and P3, where P3 uses an interpolated reference with two motion vectors,one for each of P1 and P2.

FIG. 20 is a frame sequence showing the case of four P frames P1, P2,P3, and P4, where P4 uses an interpolated reference with three motionvectors, one for each of P1, P2, and P3.

FIG. 21 is a diagram showing a sequence of P and B frames in whichvarious P frames have one or more motion vectors referencing variousprevious P frames, and showing different weights assigned to respectiveforward and backward references by a particular B frame.

FIG. 22 is a diagram showing a sequence of P and B frames in which thebitstream order of the P frames differs from the display order.

FIG. 23 is a diagram showing a sequence of P and B frames with assignedweightings.

FIG. 24 is a graph of position of an object within a frame versus time.

Like reference symbols in the various drawings indicate like elements.

DETAILED DESCRIPTION Overview

One aspect of the invention is based upon recognition that it is commonpractice to use a value for M of 3, which provides for two B framesbetween each P (or I) frame. However M=2, and M=4 or higher, are alluseful. It is of particular significance to note that the value of M(the number of B frames plus 1) also bears a natural relationship to theframe rate. At 24 frames per second (fps), the rate of film movies, the1/24th second time distance between frames can result in substantialimage changes frame-to-frame. At 60 fps, 72 fps, or higher frame rates,however, the time distance between adjacent frames becomescorrespondingly reduced. The result is that higher numbers of B frames(i.e., higher values of M) become useful and beneficial in compressionefficiency as the frame rate is increased.

Another aspect of the invention is based upon the recognition that bothMPEG-2 and MPEG-4 video compression utilize an oversimplified method ofinterpolation. For example, for mode 3, the bi-directional predictionfor each macroblock of a frame is an equal average of the subsequent andprevious frame macroblocks, as displaced by the two corresponding motionvectors. This equal average is appropriate for M=2 (i.e., singleintermediate B frames), since the B frame will be equidistant in timefrom the previous and subsequent P (or I) frames. However, for allhigher values of M, only symmetrically centered B frames (i.e., themiddle frame if M=4, 6, 8, etc.) will be optimally predicted using anequal weighting. Similarly, in MPEG-4 direct mode 4, even though themotion vectors are proportionally weighted, the predicted pixel valuesfor each intermediate B frame are an equal proportion of thecorresponding pixels of the previous P (or I) and subsequent P frame.

Thus, it represents an improvement to apply an appropriate proportionalweighting, for M>2, to the predicted pixel values for each B frame. Theproportional weighting for each pixel in a current B frame correspondsto the relative position of the current B frame with respect to theprevious and subsequent P (or I) frames. Thus, if M=3, the first B framewould use ⅔ of the corresponding pixel value (motion vector adjusted)from the previous frame, and ⅓ of the corresponding pixel value from thesubsequent frame (motion vector adjusted).

FIG. 2 is a time line of frames and proportional pixel weighting valuesin accordance with this aspect of the invention. The pixel values withineach macroblock of each intermediate B frame 201 a, 201 b are weightedas a function of “distance” between the previous P or I frame A and thenext P or I frame B, with greater weight being accorded to closer I or Pframes. That is, each pixel value of a bi-directionally predicted Bframe is a weighted combination of the corresponding pixel values ofbracketing non-bidirectionally predicted frames A and B. In thisexample, for M=3, the weighting for the first B frame 201 a is equal to⅔A+⅓B; the weighting for the second B frame 201 b is equal to ⅓A+⅔B.Also shown is the equal average weighting that would be assigned underconventional MPEG systems; the MPEG-1, 2, and 4 weighting for each Bframe 201 a, 201 b would be equal to (A+B)/2.

Application to Extended Dynamic Range and Contrast Range

If M is greater than 2, proportional weighting of pixel values inintermediate B frames will improve the effectiveness of bi-directional(mode 3) and direct (MPEG-4 mode 4) coding in many cases. Example casesinclude common movie and video editing effects such as fade-outs andcross-dissolves. These types of video effects are problem coding casesfor both MPEG-2 and MPEG-4 due to use of a simple DC matching algorithm,and the common use of M=3 (i.e., two intermediate B frames), resultingin equal proportions for B frames. Coding of such cases is improved byusing proportional B frame interpolation in accordance with theinvention.

Proportional B frame interpolation also has direct application to codingefficiency improvement for extending dynamic and contrast range. Acommon occurrence in image coding is a change in illumination. Thisoccurs when an object moves gradually into (or out from) shadow (softshadow edges). If a logarithmic coding representation is used forbrightness (as embodied by logarithmic luminance Y, for example), then alighting brightness change will be a DC offset change. If the brightnessof the lighting drops to half, the pixel values will all be decreased byan equal amount. Thus, to code this change, an AC match should be found,and a coded DC difference applied to the region. Such a DC differencebeing coded into a P frame should be proportionally applied in eachintervening B frame as well. (See co-pending U.S. patent applicationSer. No. 09/905,039, entitled “Method and System for ImprovingCompressed Image Chroma Information”, assigned to the assignee of thepresent invention and hereby incorporated by reference, for additionalinformation on logarithmic coding representations).

In addition to changes in illumination, changes in contrast also benefitfrom proportional B frame interpolation. For example, as an airplanemoves toward a viewer out of a cloud or haze, its contrast willgradually increase. This contrast increase will be expressed as anincreased amplitude in the AC coefficients of the DCT in thecorresponding P frame coded macroblocks. Again, contrast changes inintervening B frames will be most closely approximated by a proportionalinterpolation, thus improving coding efficiency.

Improvements in dynamic range and contrast coding efficiency usingproportional B frame interpolation become increasingly significant asframe rates become higher and as the value of M is increased.

Applying High M Values to Temporal Layering

Using embodiments of the invention allows an increase in the value of M,and hence the number of B frames between bracketing P and/or I frames,while maintaining or gaining coding efficiency. Such usage benefits anumber of applications, including temporal layering. For example, inU.S. Pat. No. 5,988,863, entitled “Temporal and Resolution Layering forAdvanced Television” (assigned to the assignee of the present invention,and incorporated by reference), it was noted that B frames are asuitable mechanism for layered temporal (frame) rates. The flexibilityof such rates is related to the number of consecutive B framesavailable. For example, single B frames (M=2) can support a 36 fpsdecoded temporal layer within a 72 fps stream or a 30 fps decodedtemporal layer within a 60 fps stream. Triple B frames (M=4) can supportboth 36 fps and 18 fps decoded temporal layers within a 72 fps stream,and 30 fps and 15 fps decoded temporal layers within a 60 fps stream.Using M=10 within a 120 fps stream can support 12 fps, 24 fps, and 60fps decoded temporal layers. M=4 also can be used with a 144 fps streamto provide for decoded temporal layers at 72 fps and 36 fps.

As an improvement to taking every N^(th) frame, multiple frames at 120fps or 72 fps can be decoded and proportionally blended, as described inco-pending U.S. patent application Ser. No. 09/545,233, entitled“Enhancements to Temporal and Resolution Layering” (assigned to theassignee of the present invention and incorporated by reference), toimprove the motion blur characteristics of the 24 fps results.

Even higher frame rates can be synthesized utilizing the methodsdescribed in co-pending U.S. patent application Ser. No. 09/435,277,entitled “System and Method for Motion Compensation and Frame RateConversion” (assigned to the assignee of the present invention andincorporated by reference). For example, a 72 fps camera original can beutilized with motion compensated frame rate conversion to create aneffective frame rate of 288 frames per second. Using M=12, both 48 fpsand 24 fps frame rates can be derived, as well as other useful ratessuch as 144 fps, 96 fps, and 32 fps (and of course, the original 72fps). The frame rate conversions using this method need not be integralmultiples. For example, an effective rate of 120 fps can be created froma 72 fps source, and then used as a source for both 60 fps and 24 fpsrates (using M=10).

Thus, there are temporal layering benefits to optimizing the performanceof B frame interpolation. The proportional B frame interpolationdescribed above make higher numbers of consecutive B frames functionmore efficiently, thereby enabling these benefits.

Blended B-Frame Interpolation Proportions

One reason that equal average weighting has been used in conventionalsystems as the motion compensated mode predictor for B frame pixelvalues is that the P (or I) frame before or after a particular B framemay be noisy, and therefore represent an imperfect match. Equal blendingwill optimize the reduction of noise in the interpolatedmotion-compensated block. There is a difference residual that is codedusing the quantized DCT function. Of course, the better the match fromthe motion compensated proportion, the fewer difference residual bitswill be required, and the higher the resulting image quality.

In cases where there are objects moving in and out of shadow or haze, atrue proportion where M>2 provides a better prediction. However, whenlighting and contrast changes are not occurring, equal weighting mayprove to be a better predictor, since the errors of moving a macroblockforward along a motion vector will be averaged with the errors from thebackward displaced block, thus reducing the errors in each by half. Evenso, it is more likely that B frame macroblocks nearer a P (or I) framewill correlate more to that frame than to a more distant P (or I) frame.

Thus, it is desirable in some circumstances, such as regional contrastor brightness change, to utilize a true proportion for B framemacroblock pixel weighting (for both luminance and color), as describedabove. In other circumstances, it may be more optimal to utilize equalproportions, as in MPEG-2 and MPEG-4.

Another aspect of the invention utilizes a blend of these two proportiontechniques (equal average and frame-distance proportion) for B framepixel interpolation. For example, in the M=3 case, ¾ of the ⅓ and ⅔proportions can be blended with ¼ of the equal average, resulting in thetwo proportions being ⅜ and ⅝. This technique may be generalized byusing a “blend factor” F:

Weight=F·(FrameDistanceProportionalWeight)+(1−F)·(EqualAverageWeight)

The useful range of the blend factor F is from 1, indicating purelyproportional interpolation, to 0, indicating purely equal average (thereverse assignment of values may also be used).

FIG. 3 is a time line of frames and blended, proportional, and equalpixel weighting values in accordance with this aspect of the invention.The pixel values of each macroblock of each intermediate B frame 301 a,301 b are weighted as a function of “time distance” between the previousP or I frame A and the next P or I frame B, and as a function of theequal average of A and B. In this example, for M=3 and a blend factorF=¾, the blended weighting for the first B frame 301 a is equal to ⅝A+⅜B(i.e., ¾ of the proportional weighting of ⅔A+⅓B, plus ¼ of the equalaverage weighting of (A+B)/2). Similarly, the weighting for the second Bframe 301 b is equal to ⅜A+⅝B.

The value of the blend factor F can be set overall for a completeencoding, or for each group of pictures (GOP), a range of B frames, eachB frame, or each region within a B frame (including, for example, asfinely as for each macroblock or, in the case of MPEG-4 direct modeusing a P vector in 8×8 mode, even individual 8×8 motion blocks).

In the interest of bit economy, and reflecting the fact that the blendproportion is not usually important enough to be conveyed with eachmacroblock, optimal use of blending should be related to the type ofimages being compressed. For example, for images that are fading,dissolving, or where overall lighting or contrast is gradually changing,a blend factor F near or at 1 (i.e., selecting proportionalinterpolation) is generally most optimal. For running images withoutsuch lighting or contrast changes, then lower blend factor values, suchas ⅔, ½, or ⅓, might form a best choice, thereby preserving some of thebenefits of proportional interpolation as well as some of the benefitsof equal average interpolation. All blend factor values within the 0 to1 range generally will be useful, with one particular value within thisrange proving optimal for any given B frame.

For wide dynamic range and wide contrast range images, the blend factorcan be determined regionally, depending upon the local regioncharacteristics. In general, however, a wide range of light and contrastrecommends toward blend factor values favoring purely proportional,rather than equal average, interpolation.

An optimal blend factor is generally empirically determined, althoughexperience with particular types of scenes can be used to create a tableof blend factors by scene type. For example, a determination of imagechange characteristics can be used to select the blend proportion for aframe or region. Alternatively, B frames can be coded using a number ofcandidate blend factors (either for the whole frame, or regionally),with each then being evaluated to optimize the image quality(determined, for example, by the highest signal to noise ratio, or SNR)and for lowest bit count. These candidate evaluations can then be usedto select the best value for the blend proportion. A combination of bothimage change characteristics and coded quality/efficiency can also beused.

B frames near the middle of a sequence of B frames, or resulting fromlow values of M, are not affected very much by proportionalinterpolation, since the computed proportions are already near the equalaverage. However, for higher values of M, the extreme B frame positionscan be significantly affected by the choice of blend factor. Note thatthe blend factor can be different for these extreme positions, utilizingmore of the average, than the more central positions, which gain littleor no benefit from deviating from the average, since they already havehigh proportions of both neighboring P (or I) frames. For example, ifM=5, the first and fourth B frame might use a blend factor F whichblends in more of the equal average, but the second and third middle Bframes may use the strict ⅖ and ⅗ equal average proportions. If theproportion-to-average blend factor varies as a function of the positionof a B frame in a sequence, the varying value of the blend factor can beconveyed in the compressed bitstream or as side information to thedecoder.

If a static general blend factor is required (due to lack of a method toconvey the value), then the value of ⅔ is usually near optimal, and canbe selected as a static value for B frame interpolation in both theencoder and decoder. For example, using F=⅔ for the blend factor, forM=3 the successive frame proportions will be 7/18 ( 7/18=⅔*⅓+⅓*½) and11/18 ( 11/18=⅔*⅔+⅓*½).

Linear Interpolation

Video frame pixel values are generally stored in a particularrepresentation that maps the original image information to numericvalues. Such a mapping may result in a linear or non-linearrepresentation. For example, luminance values used in compression arenon-linear. The use of various forms of non-linear representationinclude logarithmic, exponential (to various powers), and exponentialwith a black correction (commonly used for video signals).

Over narrow dynamic ranges, or for interpolations of nearby regions, thenon-linear representation is acceptable, since these nearbyinterpolations represent piece-wise linear interpolations. Thus, smallvariations in brightness are reasonably approximated by linearinterpolation. However, for wide variations in brightness, such as occurin wide dynamic range and wide contrast range images, the treatment ofnon-linear signals as linear will be inaccurate. Even for normalcontrast range images, linear fades and cross-dissolves can be degradedby a linear interpolation. Some fades and cross-dissolves utilizenon-linear fade and dissolve rates, adding further complexity.

Thus, an additional improvement to the use of proportional blends, oreven simple proportional or equal average interpolations, is to performsuch interpolations on pixel values represented in a linear space, or inother optimized non-linear spaces differing from the original non-linearluminance representation.

This may be accomplished, for example, by first converting the twonon-linear luminance signals (from the previous and subsequent P (or I)frames into a linear representation, or a differing non-linearrepresentation. Then a proportional blend is applied, after which theinverse conversion is applied, yielding the blended result in theimage's original non-linear luminance representation. However, theproportion function will have been performed on a more optimalrepresentation of the luminance signals.

It is also useful to beneficially apply this linear or non-linearconversion to color (chroma) values, in addition to luminance, whencolors are fading or becoming more saturated, as occurs in contrastchanges associated with variations in haze and overcast.

Example Embodiment

FIG. 4 is a flowchart showing an illustrative embodiment of theinvention as a method that may be computer implemented:

Step 400: In a video image compression system, for direct andinterpolative mode for computing B frames, determine an interpolationvalue to apply to each pixel of an input sequence of two or morebi-directionally predicted intermediate frames using one of (1) theframe-distance proportion or (2) a blend of equal weighting and theframe-distance proportion, derived from at least two non-bidirectionallypredicted frames bracketing such sequence input from a source (e.g., avideo image stream).

Step 401: Optimize the interpolation value with respect to an image unit(e.g., a group of pictures (GOP), a sequence of frames, a scene, aframe, a region within a frame, a macroblock, a DCT block, or similaruseful grouping or selection of pixels). The interpolation value may beset statically for the entire encoding session, or dynamically for eachimage unit.

Step 402: Further optimize the interpolation value with respect to scenetype or coding simplicity. For example, an interpolation value may beset: statically (such as ⅔ proportional and ⅓ equal average);proportionally for frames near the equal average, but blended with equalaverage near the adjacent P (or I) frames; dynamically based uponoverall scene characteristics, such as fades and cross dissolves;dynamically (and locally) based on local image region characteristics,such as local contrast and local dynamic range; or dynamically (andlocally) based upon coding performance (such as highest coded SNR) andminimum coded bits generated.

Step 403: Convey the appropriate proportion amounts to the decoder, ifnot statically determined.

Step 404: Optionally, convert the luminance (and, optionally, chroma)information for each frame to a linear or alternate non-linearrepresentation, and convey this alternate representation to the decoder,if not statically determined.

Step 405: Determine the proportional pixel values using the determinedinterpolation value.

Step 406: If necessary (because of Step 404), reconvert to the originalrepresentation.

Extended P Frame Reference

As noted above, in prior art MPEG-1, 2, and 4 compression methods, Pframes reference the previous P or I frame, and B frames reference thenearest previous and subsequent P and/or I frames. The same technique isused in the H.261 and H.263 motion-compensated DCT compressionstandards, which encompass low bit rate compression techniques.

In the H.263++ and H.26L standard in development, B frame referencingwas extended to point to P or I frames which were not directlybracketing a current frame. That is, macro blocks within B frames couldpoint to one P or I frame before the previous P frame, or to one P or Iframe after the subsequent P frame. With one or more bits permacroblock, skipping of the previous or subsequent P frame can besignaled simply. Conceptually, the use of previous P frames forreference in B frames only requires storage. For the low-bit rate-codinguse of H.263++ or H.26L, this is a small amount of additional memory.For subsequent P frame reference, the P frame coding order must bemodified with respect to B frame coding, such that future P frames (orpossibly I frames) must be decoded before intervening B frames. Thus,coding order is also an issue for subsequent P frame references.

The primary distinctions between P and B frame types are: (1) B framesmay be bi-directionally referenced (up to two motion vectors permacroblock); (2) B frames are discarded after use (which also means thatthey can be skipped during decoding to provide temporal layering); and(3) P frames are used as “stepping stones”, one to the next, since eachP frame must be decoded for use as a reference for each subsequent Pframe.

As another aspect of the invention, P frames (as opposed to B frames)are decoded with reference to one or more previous P or I frames(excluding the case of each P frame referencing only the nearestprevious P or I frame). Thus, for example, two or more motion vectorsper macroblock may be used for a current P frame, all pointing backwardin time (i.e., to one or more previously decoded frames). Such P framesstill maintain a “stepping stone” character. FIG. 5 is a diagram showingan example of multiple previous references by a current P frame 500 totwo prior P frames 502, 504, and to a prior I frame 506.

Further, it is possible to apply the concepts of macroblockinterpolation, as described above, in such P frame references. Thus, inaddition to signaling single references to more than one previous P or Iframe, it is also possible to blend proportions of multiple previous Por I frames, using one motion vector for each such frame reference. Forexample, the technique described above of using a B frame interpolationmode having two frame references may be applied to allow any macroblockin a P frame to reference two previous P frames or one previous P frameand one previous I frame, using two motion vectors. This techniqueinterpolates between two motion vectors, but is not bi-directional intime (as is the case with B frame interpolation), since both motionvectors point backward in time. Memory costs have decreased to the pointwhere holding multiple previous P or I frames in memory for suchconcurrent reference is quite practical.

In applying such P frame interpolation, it is constructive to select andsignal to a decoder various useful proportions of the previous two ormore P frames (and, optionally, one prior I frame). In particular, anequal blend of frames is one of the useful blend proportions. Forexample, with two previous P frames as references, an equal ½ amount ofeach P frame can be blended. For three previous P frames, a ⅓ equalblend could be used. Another useful blend of two P frames is ⅔ of themost recent previous frame, and ⅓ of the least recent previous frame.For three previous P frames, another useful blend is ½ of the mostrecent previous frame, ⅓ of the next most recent previous frame, and ⅙of the least recent previous frame.

In any case, a simple set of useful blends of multiple previous P frames(and, optionally, one I frame) can be utilized and signaled simply froman encoder to a decoder. The specific blend proportions utilized can beselected as often as useful to optimize coding efficiency for an imageunit. A number of blend proportions can be selected using a small numberof bits, which can be conveyed to the decoder whenever suitable for adesired image unit.

As another aspect of the invention, it is also useful to switch-selectsingle P frame references from the most recent previous P (or I) frameto a more “distant” previous P (or I) frame. In this way, P frames wouldutilize a single motion vector per macroblock (or, optionally, per 8×8block in MPEG-4 style coding), but would utilize one or more bits toindicate that the reference refers to a single specific previous frame.P frame macroblocks in this mode would not be interpolative, but insteadwould reference a selected previous frame, being selected from apossible two, three, or more previous P (or I) frame choices forreference. For example, a 2-bit code could designate one of up to fourprevious frames as the single reference frame of choice. This 2-bit codecould be changed at any convenient image unit.

Adaptive Number of B Frames

It is typical in MPEG coding to use a fixed pattern of I, P, and B frametypes. The number of B frames between P frames is typically a constant.For example, it is typical in MPEG-2 coding to use two B frames betweenP (or I) frames. FIG. 6A is a diagram of a typical prior art MPEG-2coding pattern, showing a constant number of B frames (i.e., two)between bracketing I frames 600 and/or P frames 602.

The MPEG-4 video coding standard conceptually allows a varying number ofB frames between bracketing I frames and/or P frames, and a varyingamount of distance between I frames. FIG. 6B is a diagram of atheoretically possible prior art MPEG-4 video coding pattern, showing avarying number of B frames between bracketing I frames 600 and/or Pframes 602, as well as a varying distance between I frames 600.

This flexible coding structure theoretically can be utilized to improvecoding efficiency by matching the most effective B and P frame codingtypes to the moving image frames. While this flexibility has beenspecifically allowed, it has been explored very little, and no mechanismis known for actually determining the placement of B and P frames insuch a flexible structure.

Another aspect of the invention applies the concepts described herein tothis flexible coding structure as well as to the simple fixed codingpatterns in common use. B frames thus can be interpolated using themethods described above, while P frames may reference more than oneprevious P or I frame and be interpolated in accordance with the presentdescription.

In particular, macroblocks within B frames can utilize proportionalblends appropriate for a flexible coding structure as effectively aswith a fixed structure. Proportional blends can also be utilized when Bframes reference P or I frames that are further away than the nearestbracketing P or I frames.

Similarly, P frames can reference more than one previous P or I frame inthis flexible coding structure as effectively as with a fixed patternstructure. Further, blend proportions can be applied to macroblocks insuch P frames when they reference more than one previous P frame (plus,optionally, one I frame).

(A) Determining Placement in Flexible Coding Patterns

The following method allows an encoder to optimize the efficiency ofboth the frame coding pattern as well as the blend proportions utilized.For a selected range of frames, a number of candidate coding patternscan be tried, to determine an optimal or near optimal (relative tospecified criteria) pattern. FIG. 7 is a diagram of code patterns thatcan be examined. An initial sequence 700, ending in a P or I frame, isarbitrarily selected, and is used as a base for adding additional Pand/or B frames, which are then evaluated (as described below). In oneembodiment, a P frame is added to the initial sequence 700 to create afirst test sequence 702 for evaluation. If the evaluation issatisfactory, an intervening B frame is inserted to create a second testsequence 704. For each satisfactory evaluation, additional B frames areinserted to create increasingly longer test sequences 706-712, until theevaluation criteria become unsatisfactory. At that point, the previouscoding sequence is accepted. This process is then repeated, using theend P frame for the previously accepted coding sequence as the startingpoint for adding a new P frame and then inserting new B frames.

An optimal or near optimal coding pattern can be selected based uponvarious evaluation criteria, often involving tradeoffs of various codingcharacteristics, such as coded image quality versus number of codingbits required. Common evaluation criteria include the least number ofbits used (in a fixed quantization parameter test), or the bestsignal-to-noise-ratio (in a fixed bit-rate test), or a combination ofboth.

It is also common to minimize a sum-of-absolute-difference (SAD), whichforms a measure of DC match. As described in co-pending U.S. patent Ser.No. 09/904,192, entitled “Motion Estimation for Video CompressionSystems” (assigned to the assignee of the present invention and herebyincorporated by reference), an AC match criterion is also a usefulmeasure of the quality of a particular candidate match (the patentapplication also describes other useful optimizations). Thus, the AC andDC match criteria, accumulated over the best matches of all macroblocks,can be examined to determine the overall match quality of each candidatecoding pattern. This AC/DC match technique can augment or replace thesignal-to-noise ratio (SNR) and least-bits-used tests when used togetherwith an estimate of the number of coded bits for each frame patterntype. It is typical to code macroblocks within B frames with a higherquantization parameter (QP) value than for P frames, affecting both thequality (measured often as a signal-to-noise ratio) and the number ofbits used within the various candidate coding patterns.

(B) Blend Proportion Optimization in Flexible Coding Patterns

Optionally, for each candidate pattern determined in accordance with theabove method, blend proportions may be tested for suitability (e.g.,optimal or near optimal blend proportions) relative to one or morecriteria. This can be done, for example, by testing for best quality(lowest SNR) and/or efficiency (least bits used). The use of one or moreprevious references for each macroblock in P frames can also bedetermined in the same way, testing each candidate reference pattern andblend proportion, to determine a set of one or more suitable references.

Once the coding pattern for this next step (Step 700 in FIG. 7) has beenselected, then the subsequent steps (Steps 702-712) can be tested forvarious candidate coding patterns. In this way, a more efficient codingof a moving image sequence can be determined. Thus, efficiency can beoptimized/improved as described in subsection (A) above; blendoptimization can be applied at each tested coding step.

DC vs. AC Interpolation

In many cases of image coding, such as when using a logarithmicrepresentation of image frames, the above-described interpolation offrame pixel values will optimally code changes in illumination. However,in alternative video “gamma-curve”, linear, and other representations,it will often prove useful to apply different interpolation blendfactors to the DC values than to the AC values of the pixels. FIG. 8 isa flowchart showing one embodiment of an interpolation method with DCinterpolation being distinct from AC interpolation. For a selected imageregion (usually a DCT block or macroblock) from a first and second inputframe 802, 802′, the average pixel value for each such region issubtracted 804, 804′, thereby separating the DC value (i.e., the averagevalue of the entire selected region) 806, 806′ from the AC values (i.e.,the signed pixel values remaining) 808, 808′ in the selected regions.The respective DC values 806, 806′ can then be multiplied byinterpolation weightings 810, 810′ different from the interpolationweightings 814, 814′ used to multiply the AC (signed) pixel values 808,808′. The newly interpolated DC value 812 and the newly interpolated ACvalues 816 can then be combined 818, resulting in a new prediction 820for the selected region.

As with the other interpolation values in this invention, theappropriate weightings can be signaled to a decoder per image unit. Asmall number of bits can select between a number of interpolationvalues, as well as selecting the independent interpolation of the ACversus DC aspects of the pixel values.

Linear & Non-Linear Interpolation

Interpolation is a linear weighted average. Since the interpolationoperation is linear, and since the pixel values in each image frame areoften represented in a non-linear form (such as video gamma orlogarithmic representations), further optimization of the interpolationprocess becomes possible. For example, interpolation of pixels for aparticular sequence of frames, as well as interpolation of DC valuesseparately from AC values, will sometimes be optimal or near optimalwith a linear pixel representation. However, for other frame sequences,such interpolation will be optimal or near optimal if the pixels arerepresented as logarithmic values or in other pixel representations.Further, the optimal or near optimal representations for interpolating Uand V (chroma) signal components may differ from the optimal or nearoptimal representations for the Y (luminance) signal component. It istherefore a useful aspect of the invention to convert a pixelrepresentation to an alternate representation as part of theinterpolation procedure.

FIG. 9 is a flowchart showing one embodiment of a method forinterpolation of luminance pixels using an alternative representation.Starting with a region or block of luminance (Y) pixels in an initialrepresentation (e.g., video gamma or logarithmic) (Step 900), the pixeldata is transformed to an alternative representation (e.g., linear,logarithmic, video gamma) different from the initial representation(Step 902). The transformed pixel region or block is then interpolatedas described above (Step 906), and transformed back to the initialrepresentation (Step 906). The result is interpolated pixel luminancevalues (Step 908).

FIG. 10 is a flowchart showing one embodiment of a method forinterpolation of chroma pixels using an alternative representation.Starting with a region or block of chroma (U, V) pixels in an initialrepresentation (e.g., video gamma or logarithmic) (Step 1000), the pixeldata is transformed to an alternative representation (e.g., linear,logarithmic, video gamma) different from the initial representation(Step 1002). The transformed pixel region or block is then interpolatedas described above (Step 1006), and transformed back to the initialrepresentation (Step 1006). The result is interpolated pixel chromavalues (Step 1008).

The transformations between representations may be performed inaccordance with the teachings of U.S. patent application Ser. No.09/905,039, entitled “Method and System for Improving Compressed ImageChroma Information”, assigned to the assignee of the present inventionand hereby incorporated by reference. Note that the alternativerepresentation transformation and its inverse can often be performedusing a simple lookup table.

As a variation of this aspect of the invention, the alternative (linearor non-linear) representation space for AC interpolation may differ fromthe alternative representation space for DC interpolation.

As with the interpolation weightings, the selection of which alternateinterpolation representation is to be used for each of the luminance (Y)and chroma (U and V) pixel representations may be signaled to thedecoder using a small number of bits for each selected image unit.

Number of Motion Vectors per Macroblock

In MPEG-2, one motion vector is allowed per 16×16 macroblock in Pframes. In B frames, MPEG-2 allows a maximum of 2 motion vectors per16×16 macroblock, corresponding to the bi-directional interpolativemode. In MPEG-4 video coding, up to 4 motion vectors are allowed per16×16 macroblock in P frames, corresponding to one motion vector per 8×8DCT block. In MPEG-4 B frames, a maximum of two motion vectors areallowed for each 16×16 macroblock, when using interpolative mode. Asingle motion vector delta in MPEG-4 direct mode can result in fourindependent “implicit” motion vectors, if the subsequent corresponding Pframe macroblock was set in 8×8 mode having four vectors. This isachieved by adding the one motion vector delta carried in a 16×16 Bframe macroblock to each of the corresponding four independent motionvectors from the following P frame macroblock, after scaling for thedistance in time (the B frame is closer in time than the P frame'sprevious P or I frame reference).

One aspect of the invention includes the option to increase the numberof motion vectors per picture region, such as a macroblock. For example,it will sometimes prove beneficial to have more than two motion vectorsper B frame macroblock. These can be applied by referencing additional Por I frames and having three or more interpolation terms in the weightedsum. Additional motion vectors can also be applied to allow independentvectors for the 8×8 DCT blocks of the B frame macroblock. Also, fourindependent deltas can be used to extend the direct mode concept byapplying a separate delta to each of the four 8×8-region motion vectorsfrom the subsequent P frame.

Further, P frames can be adapted using B-frame implementation techniquesto reference more than one previous frame in an interpolative mode,using the B-frame two-interpolation-term technique described above. Thistechnique can readily be extended to more than two previous P or Iframes, with a resulting interpolation having three or more terms in theweighted sum.

As with other aspects of this invention (e.g., pixel representation andDC versus AC interpolation methods), particular weighted sums can becommunicated to a decoder using a small number of bits per image unit.

In applying this aspect of the invention, the correspondence between 8×8pixel DCT blocks and the motion vector field need not be as strict aswith MPEG-2 and MPEG-4. For example, it may be useful to use alternativeregion sizes other than 16×16, 16×8 (used only with interlace inMPEG-4), and 8×8 for motion vectors. Such alternatives might include anynumber of useful region sizes, such as 4×8, 8×12, 8×16, 6×12, 2×8, 4×8,24×8, 32×32, 24×24, 24×16, 8×24, 32×8, 32×4, etc. Using a small numberof such useful sizes, a few bits can signal to a decoder thecorrespondence between motion vectors region sizes and DCT block sizes.In systems where a conventional 8×8 DCT block is used, a simple set ofcorrespondences to the motion vector field are useful to simplifyprocessing during motion compensation. In systems where the DCT blocksize is different from 8×8, then greater flexibility can be achieved inspecifying the motion vector field, as described in co-pending U.S.patent application Ser. No. 09/545,233, entitled “Enhanced Temporal andResolution Layering in Advanced Television”, assigned to the assignee ofthe present invention and hereby incorporated by reference. Note thatmotion vector region boundaries need not correspond to DCT regionboundaries. Indeed, it is often useful to define motion vector regionsin such a way that a motion vector region edge falls within a DCT block(and not at its edge).

The concept of extending the flexibility of the motion vector field alsoapplies to the interpolation aspect of this invention. As long as thecorrespondence between each pixel and one or more motion vectors to oneor more reference frames is specified, the interpolation methoddescribed above can be applied to the full flexibility of useful motionvectors using all of the generality of this invention. Even the size ofthe regions corresponding to each motion vector can differ for eachprevious frame reference when using P frames, and each previous andfuture frame reference when using B frames. If the region sizes formotion vectors differ when applying the improved interpolation method ofthis invention, then the interpolation reflects the common region ofoverlap. The common region of overlap for motion vector references canbe utilized as the region over which the DC term is determined whenseparately interpolating DC and AC pixel values.

FIG. 11 is a diagram showing unique motion vector region sizes 1100,1102 for each of two P frames 1104, 1106. Before computing interpolationvalues in accordance with this invention, the union 1108 of the motionvector region sizes is determined. The union 1108 defines all of theregions which are considered to have an assigned motion vector.

Thus, for example, in interpolating 4×4 DCT regions of a B frame 1112backwards to the prior P frame 1104, a 4×4 region 1110 within the union1108 would use the motion vector corresponding to the 8×16 region 1114in the prior P frame. If predicting forward, the region 1110 within theunion 1108 would use the motion vector corresponding to the 4×16 region1115 in the next P frame. Similarly, interpolation of the region 116within the union 1108 backwards would use the motion vectorcorresponding to the 8×16 region 1114, while predicting the same regionforward would use the motion vector corresponding to the 12×16 region1117.

In one embodiment of the invention, two steps are used to accomplish theinterpolation of generalized (i.e., non-uniform size) motion vectors.The first step is to determine the motion vector common regions, asdescribed with respect to FIG. 11. This establishes the correspondencebetween pixels and motion vectors (i.e., the number of motion vectorsper specified pixel region size) for each previous or subsequent framereference. The second step is to utilize the appropriate interpolationmethod and interpolation factors active for each region of pixels. It isa task of the encoder to ensure that optimal or near optimal motionvector regions and interpolation methods are specified, and that allpixels have their vectors and interpolation methods completelyspecified. This can be very simple in the case of a fixed pattern ofmotion vectors (such as one motion vector for each 32×8 block, specifiedfor an entire frame), with a single specified interpolation method (suchas a fixed proportion blend to each distance of referenced frame,specified for the entire frame). This method can also become quitecomplex if regional changes are made to the motion vector region sizes,and where the region sizes differ depending upon which previous orsubsequent frame is referenced (e.g., 8×8 blocks for the nearestprevious frame, and 32×8 blocks for the next nearest previous frame).Further, the interpolation method may be regionally specified within theframe.

When encoding, it is the job of the encoder to determine the optimal ornear optimal use of the bits to select between motion vector regionshapes and sizes, and to select the optimal or near optimalinterpolation method. A determination is also required to specify thenumber and distance of the frames referenced. These specifications canbe determined by exhaustive testing of a number of candidate motionvector region sizes, candidate frames to reference, and interpolationmethods for each such motion vector region, until an optimal or nearoptimal coding is found. Optimality (relative to a selected criteria)can be determined by finding the least SNR after encoding a block or thelowest number of bits for a fixed quantization parameter (QP) aftercoding the block, or by application of another suitable measure.

Direct Mode Extension

Conventional direct mode, used in B frame macroblocks in MPEG-4, can beefficient in motion vector coding, providing the benefits of 8×8 blockmode with a simple common delta. Direct mode weights each correspondingmotion vector from the subsequent P frame, which references the previousP frame, at the corresponding macroblock location based upon distance intime. For example, if M=3 (i.e., two intervening B frames), with simplelinear interpolation the first B frame would use −⅔ times the subsequentP frame motion vector to determine a pixel offset with respect to such Pframe, and ⅓ times the subsequent P frame motion vector to determine apixel offset with respect to the previous P frame. Similarly, the secondB frame would use −⅓ times the same P frame motion vector to determine apixel offset with respect to such P frame, and ⅔ times the subsequent Pframe motion vector to determine a pixel offset with respect to theprevious P frame. In direct mode, a small delta is added to eachcorresponding motion vector. As another aspect of this invention, thisconcept can be extended to B frame references which point to one or moren-away P frames, which in turn reference one or more previous orsubsequent P frames or I frames, by taking the frame distance intoaccount to determine a frame scale fraction.

FIG. 12 is a diagram showing a sequence of P and B frames withinterpolation weights for the B frames determined as a function ofdistance from a 2-away subsequent P frame that references a 1-awaysubsequent P frame. In the illustrated example, M=3, indicating twoconsecutive B frames 1200, 1202 between bracketing P frames 1204, 1206.In this example, each co-located macroblock in the next nearestsubsequent P frame 1208 (i.e., n=2) might point to the intervening(i.e., nearest) P frame 1204, and the first two B frames 1200, 1202 mayreference the next nearest subsequent P frame 1208 rather than thenearest subsequent P frame 1204, as in conventional MPEG. Thus, for thefirst B frame 1200, the frame scale fraction 5/3 times the motion vectormy from the next nearest subsequent P frame 1208 would be used as apixel offset with respect to P frame 1208, and the second B frame 1202would use an offset of 4/3 times that same motion vector. If a nearestsubsequent P frame referenced by a B frame points to the next nearestprevious P frame, then again the simple frame distance can be used toobtain the suitable frame scale fraction to apply to the motion vectors.FIG. 13 is a diagram showing a sequence of P and B frames withinterpolation weights for the B frames determined as a function ofdistance from a 1-away subsequent P frame that references a 2-awayprevious P frame. In the illustrated example, M=3, and B frames 1300,1302 reference the nearest subsequent P frame 1304, which in turnreferences the 2-away P frame 1306. Thus, for the first B frame 1300,the pixel offset fraction is the frame scale fraction 2/6 multiplied bythe motion vector my from the nearest subsequent P frame 1304, and thesecond B frame 1302 would have a pixel offset of the frame scalefraction ⅙ multiplied by that same motion vector, since the motionvector of the nearest subsequent P frame 1304 points to the 2-awayprevious P frame 1306, which is 6 frames distant.

In general, in the case of a B frame referencing a single P frame indirect mode, the frame distance method sets the numerator of a framescale fraction equal to the frame distance from that B frame to itsreferenced, or “target”, P frame, and sets the denominator equal to theframe distance from the target P frame to another P frame referenced bythe target P frame. The sign of the frame scale fraction is negative formeasurements made from a B frame to a subsequent P frame, and positivefor measurements made from a B frame to a prior P frame. This simplemethod of applying a frame-distance or the frame scale fraction to a Pframe motion vector can achieve an effective direct mode coding.

Further, another aspect of this invention is to allow direct mode toapply to multiple interpolated motion vector references of a P frame.For example, if a P frame was interpolated from the nearest and nextnearest previous P frames, direct mode reference in accordance with thisaspect of the invention allows an interpolated blend for each multiplereference direct mode B frame macroblock. In general, the two or moremotion vectors of a P frame can have an appropriate frame scale fractionapplied. The two or more frame-distance modified motion vectors then canbe used with corresponding interpolation weights for each B framereferencing or targeting that P frame, as described below, to generateinterpolated B frame macroblock motion compensation.

FIG. 14 is a diagram showing a sequence of P and B frames in which asubsequent P frame has multiple motion vectors referencing prior Pframes. In this example, a B frame 1400 references a subsequent P frameP3. This P3 frame in turn has two motion vectors, mv1 and mv2, thatreference corresponding prior P frames P2, P1. In this example, eachmacroblock of the B frame 1400 can be interpolated in direct mode usingeither of two weighting terms or a combination of such weighing terms.

Each macroblock for the B frame 1400 would be constructed as a blendfrom:

-   -   corresponding pixels of frame P2 displaced by the frame scale        fraction ⅓ of mv1 (where the pixels may then be multiplied by        some proportional weight i) plus corresponding pixels of frame        P3 displaced by the frame scale fraction −⅔ of mv1 (where the        pixels may then be multiplied by some proportional weight j);        and    -   corresponding pixels of frame P1 displaced by the frame scale        fraction ⅔ ( 4/6) of mv2 (where the pixels may then be        multiplied by some proportional weight k) plus corresponding        pixels of frame P3 displaced by the frame scale fraction −⅓ (−        2/6) of mv2 (where the pixels may then be multiplied by some        proportional weight 1).

As with all direct modes, a motion vector delta can be utilized witheach of mv1 and mv2.

In accordance with this aspect of the invention, direct mode predictedmacroblocks in B frames can also reference multiple subsequent P frames,using the same methodology of interpolation and motion vector framescale fraction application as with multiple previous P frames. FIG. 15is a diagram showing a sequence of P and B frames in which a nearestsubsequent P frame has a motion vector referencing a prior P frame, anda next nearest subsequent P frame has multiple motion vectorsreferencing prior P frames. In this example, a B frame 1500 referencestwo subsequent P frames P2, P3. The P3 frame has two motion vectors, mv1and mv2, that reference corresponding prior P frames P2, P1. The P2frame has one motion vector, mv3, which references the prior P frame P1.In this example, each macroblock of the B frame 1500 is interpolated indirect mode using three weighting terms. In this case, the motion vectorframe scale fractions may be greater than 1 or less than −1.

The weightings for this form of direct mode B frame macroblockinterpolation can utilize the full generality of interpolation asdescribed herein. In particular, each weight, or combinations of theweights, can be tested for best performance (e.g., quality versus numberof bits) for various image units. The interpolation fraction set forthis improved direct mode can be specified to a decoder with a smallnumber of bits per image unit.

Each macroblock for the B frame 1500 would be constructed as a blendfrom:

-   -   corresponding pixels of frame P3 displaced by the frame scale        fraction − 5/3 of mv1 (where the pixels may then be multiplied        by some proportional weight i) plus corresponding pixels of        frame P2 displaced by the frame scale fraction −⅔ of mv1 (where        the pixels may then be multiplied by some proportional weight        j);    -   corresponding pixels of frame P3 displaced by the frame scale        fraction −⅚ of mv2 (where the pixels may then be multiplied by        some proportional weight k) plus corresponding pixels of frame        P1 displaced by the frame scale fraction ⅙ of mv2 (where the        pixels may then be multiplied by some proportional weight 1);        and    -   corresponding pixels of frame P2 displaced by the frame scale        fraction −⅔ of mv3 (where the pixels may then be multiplied by        some proportional weight m) plus corresponding pixels of frame        P1 displaced by the frame scale fraction ⅓ of mv3 (where the        pixels may then be multiplied by some proportional weight n).

As with all direct modes, a motion vector delta can be utilized witheach of mv1, mv2, and mv3.

Note that a particularly beneficial direct coding mode often occurs whenthe next nearest subsequent P frame references the nearest P framesbracketing a candidate B frame.

Direct mode coding of B frames in MPEG-4 always uses the subsequent Pframe's motion vectors as a reference. In accordance with another aspectof the invention, it is also possible for a B frame to reference themotion vectors of the previous P frame's co-located macroblocks, whichwill sometimes prove a beneficial choice of direct mode codingreference. In this case, the motion vector frame scale fractions will begreater than one, when the next nearest previous P frame is referencedby the nearest previous frame's P motion vector. FIG. 16 is a diagramshowing a sequence of P and B frames in which a nearest previous P framehas a motion vector referencing a prior P frame. In this example, a Bframe 1600 references the 1-away previous P frame P2. The motion vectormy of frame P2 references the next previous P frame P1 (2-away relativeto the B frame 1600). The appropriate frame scale fractions are shown.

If the nearest previous P frame is interpolated from multiple vectorsand frames, then methods similar to those described in conjunction withFIG. 14 apply to obtain the motion vector frame scale fractions andinterpolation weights. FIG. 17 is a diagram showing a sequence of P andB frames in which a nearest previous P frame has two motion vectorsreferencing prior P frames. In this example, a B frame 1700 referencesthe previous P frame P3. One motion vector mv1 of the previous P3 framereferences the next previous P frame P2, while the second motion vectormv2 references the 2-away previous P frame P1. The appropriate framescale fractions are shown.

Each macroblock for the B frame 1700 would be constructed as a blendfrom:

-   -   corresponding pixels of frame P3 displaced by the frame scale        fraction ⅓ of mv1 (where the pixels may then be multiplied by        some proportional weight i) plus corresponding pixels of frame        P2 displaced by the frame scale fraction 4/3 of mv1 (where the        pixels may then be multiplied by some proportional weight j);        and    -   corresponding pixels of frame P3 displaced by the frame scale        fraction ⅙ of mv2 (where the pixels may then be multiplied by        some proportional weight k) plus corresponding pixels of frame        P1 displaced by the frame scale fraction 7/6 of mv2 (where the        pixels may then be multiplied by some proportional weight 1).

When the motion vector of a previous P frame (relative to a B frame)points to the next nearest previous P frame, it is not necessary to onlyutilize the next nearest previous frame as the interpolation reference,as in FIG. 16. The nearest previous P frame may prove a better choicefor motion compensation. In this case, the motion vector of the nearestprevious P frame is shortened to the frame distance fraction from a Bframe to that P frame. FIG. 18 is a diagram showing a sequence of P andB frames in which a nearest previous P frame has a motion vectorreferencing a prior P frame. In this example, for M=3, a first B frame1800 would use ⅓ and −⅔ frame distance fractions times the motion vectormy of the nearest previous P frame P2. The second B frame 1802 would use⅔ and −⅓ frame distance fractions (not shown). Such a selection would besignaled to the decoder to distinguish this case from the case shown inFIG. 16.

As with all other coding modes, the use of direct mode preferablyinvolves testing the candidate mode against other availableinterpolation and single-vector coding modes and reference frames. Fordirect mode testing, the nearest subsequent P frame (and, optionally,the next nearest subsequent P frame or even more distant subsequent Pframes, and/or one or more previous P frames) can be tested ascandidates, and a small number of bits (typically one or two) can beused to specify the direct mode P reference frame distance(s) to be usedby a decoder.

Extended Interpolation Values

It is specified in MPEG-1, 2, and 4, as well as in the H.261 and H.263standards, that B frames use an equal weighting of pixel values of theforward referenced and backward referenced frames, as displaced by themotion vectors. Another aspect of this invention includes application ofvarious useful unequal weightings that can significantly improve B framecoding efficiency, as well as the extension of such unequal weightingsto more than two references, including two or more references backwardor forward in time. This aspect of the invention also includes methodsfor more than one frame being referenced and interpolated for P frames.Further, when two or more references point forward in time, or when twoor more references point backward in time, it will sometimes be usefulto use negative weightings as well as weightings in excess of 1.0.

For example, FIG. 19 is a frame sequence showing the case of three Pframes P1, P2, and P3, where P3 uses an interpolated reference with twomotion vectors, one for each of P1 and P2. If, for example, a continuouschange is occurring over the span of frames between P1 and P3, thenP2−P1 (i.e., the pixel values of frame P2, displaced by the motionvector for P2, minus the pixel values of frame P1, displaced by themotion vector for P1) will equal P3−P2. Similarly, P3−P1 will be doublethe magnitude of P2−P1 and P3−P2. In such a case, the pixel values forframe P3 can be predicted differentially from P1 and P2 through theformula:

P3=P1+2×(P2−P1)=(2×P2)−P1

In this case, the interpolative weights for P3 are 2.0 for P2, and −1.0for P1.

As another example, FIG. 20 is a frame sequence showing the case of fourP frames P1, P2, P3, and P4, where P4 uses an interpolated referencewith three motion vectors, one for each of P1, P2, and P3. Thus, sinceP4 is predicted from P3, P2, and P1, three motion vectors andinterpolative weights would apply. If, in this case, a continuous changewere occurring over this span of frames, then P2−P1 would equal bothP3−P2 and P4−P3, and P4−P1 would equal both 3×(P2−P1) and 3×(P3−P2).

Thus, in this example case, a prediction of P4 based upon P2 and P1would be:

P4=P1+3×(P2−P1)=(3×P2)−(2×P1) (weights 3.0 and −2.0)

The prediction of P4 based upon P3 and P1 would be:

P4=P1+ 3/2×(P3−P1)=( 3/2×P3)−(½×P1) (weights 1.5 and −0.5)

The prediction of P4 based upon P3 and P2 would be:

P4=P2+2×(P3−P2)=(2×P3)−P2 (weights 2.0 and −1.0)

However, it might also be likely that the change most near to P4,involving P3 and P2, is a more reliable predictor of P4 than predictionsinvolving P1. Thus, by giving ¼ weight to each of the two terms aboveinvolving P1, and ½ weight to the term involving only P3 and P2, wouldresult in:

½(2P3−P2)+¼( 3/2P3−½P1)+¼(3P2−2P1)=1⅜P3+¼P2−⅝P1 (weights 1.375, 0.25,and −0.625)

Accordingly, it will sometimes be useful to use weights both above 1.0and below zero. At other times, if there is noise-like variation fromone frame to the next, a positive weighted average having mildcoefficients between 0.0 and 1.0 might yield the best predictor of P4'smacroblock (or other region of pixels). For example, an equal weightingof ⅓ of each of P1, P2, and P3 in FIG. 20 might form the best predictorof P4 in some cases. Note that the motion vector of the best match isapplied to determine the region of P1, P2, P3, etc., being utilized bythe computations in this example. This match might best be an AC matchin some cases, allowing a varying DC term to be predicted through the ACcoefficients. Alternatively, if a DC match (such as Sum of AbsoluteDifference) is used, then changes in AC coefficients can often bepredicted. In other cases, various forms of motion vector match willform a best prediction with various weighting blends. In general, thebest predictor for a particular case is empirically determined using themethods described herein.

These techniques are also applicable to B frames that have two or moremotion vectors pointing either backward or forward in time. Whenpointing forward in time, the coefficient pattern described above for Pframes is reversed to accurately predict backward to the current Pframe. It is possible to have two or more motion vectors in both theforward and backward direction using this aspect of the invention,thereby predicting in both directions concurrently. A suitable weightedblend of these various predictions can be optimized by selecting theblend weighting which best predicts the macroblock (or other pixelregion) of a current B frame.

FIG. 21 is a diagram showing a sequence of P and B frames in whichvarious P frames have one or more motion vectors referencing variousprevious P frames, and showing different weights a-e assigned torespective forward and backward references by a particular B frame. Inthis example, a B frame 2100 references three previous P frames and twosubsequent P frames.

In the example illustrated in FIG. 21, frame P5 must be decoded for thisexample to work. It is useful sometimes to order frames in a bitstreamin the order needed for decoding (“delivery order”), which is notnecessarily the order of display (“display order”). For example, in aframe sequence showing cyclic motion (e.g., rotation of an object), aparticular P frame may be more similar to a distant P frame than to thenearest subsequent P frame. FIG. 22 is a diagram showing a sequence of Pand B frames in which the bitstream delivery order of the P framesdiffers from the display order. In this example, frame P3 is moresimilar to frame P5 than to frame P4. It is therefore useful to deliverand decode P5 before P4, but display P4 before P5. Preferably, each Pframe should signal to the decoder when such P frame can be discarded(e.g., an expiration of n frames in bitstream order, or after frame X inthe display order).

If the weightings are selected from a small set of choices, then a smallnumber of bits can signal to the decoder which weighting is to be used.As with all other weightings described herein, this can be signaled to adecoder once per image unit, or at any other point in the decodingprocess where a change in weightings is useful.

It is also possible to download new weighting sets. In this way, a smallnumber of weighting sets may be active at a given time. This allows asmall number of bits to signal a decoder which of the active weightingsets is to be used at any given point in the decoding process. Todetermine suitable weighting sets, a large number of weightings can betested during encoding. If a small subset is found to provide highefficiency, then that subset can be signaled to a decoder for use. Aparticular element of the subset can thus be signaled to the decoderwith just a few bits. For example, 10 bits can select 1 of 1024 subsetelements. Further, when a particular small subset should be changed tomaintain efficiency, a new subset can be signaled to the decoder. Thus,an encoder can dynamically optimize the number of bits required toselect among weighting set elements versus the number of bits needed toupdate the weighting sets. Further, a small number of short codes can beused to signal common useful weightings, such as ½, ⅓, ¼, etc. In thisway, a small number of bits can be used to signal the set of weightings,such as for a K-forward-vector prediction in a P frame (where K=1, 2, 3,. . . ), or a K-forward-vector and L-backward-vector prediction in a Bframe (where K and L are selected from 0, 1, 2, 3, . . . ), or aK-forward-vector and L-backward-vector prediction in a P frame (where Kand L are selected from 0, 1, 2, 3, . . . ), as a function of thecurrent M value (i.e., the relative position of the B frame with respectto the neighboring P (or I) frames).

FIG. 23 is a diagram showing a sequence of P and B frames with assignedweightings. A B frame 2300 has weights a-e, the values of which areassigned from a table of B frame weighting sets 2302. A P frame 2304 hasweights m, n, the values of which are assigned from a table of P frameweighting sets 2306. Some weightings can be static (i.e., permanentlydownloaded to the decoder), and signaled by an encoder. Other weightingsmay be dynamically downloaded and then signaled.

This same technique may be used to dynamically update weighting sets toselect DC interpolation versus AC interpolation. Further, code valuescan be signaled which select normal (linear) interpolation (of pixelvalues normally represented in a non-linear representation) versuslinear interpolation of converted values (in an alternate linear ornon-linear representation). Similarly, such code values can signal whichsuch interpolation to apply to AC or DC values or whether to split ACand DC portions of the prediction.

Active subsetting can also be used to minimize the number of bitsnecessary to select between the sets of weighting coefficients currentlyin use. For example, if 1024 downloaded weighting sets were held in adecoder, perhaps 16 might need to be active during one particularportion of a frame. Thus, by selecting which subset of 16 (out of 1024)weighting sets are to be active, only 4 bits need be used to selectwhich weighting set of these 16 is active. The subsets can also besignaled using short codes for the most common subsets, thus allowing asmall number of bits to select among commonly used subsets.

Softening and Sharpening

As with the simple separation of a DC component from AC signals viasubtraction of the average value, other filtering operations are alsopossible during motion vector compensated prediction. For example,various high-pass, band-pass, and low-pass filters can be applied to apixel region (such as a macroblock) to extract various frequency bands.These frequency bands can then be modified when performing motioncompensation. For example, it often might be useful on a noisy movingimage to filter out the highest frequencies in order to soften (makeless sharp, or blur slightly) the image. The softer image pixels,combined with a steeper tilt matrix for quantization (a steeper tiltmatrix ignores more high-frequency noise in the current block), willusually form a more efficient coding method. It is already possible tosignal a change in the quantization tilt matrix for every image unit. Itis also possible to download custom tilt matrices for luminance andchroma. Note that the effectiveness of motion compensation can beimproved whether the tilt matrix is changed or not. However, it willoften be most effective to change both the tilt matrix and filterparameters which are applied during motion compensation.

It is common practice to use reduced resolution for chroma codingtogether with a chroma specific tilt matrix. However, the resolution ofchroma coding is static in this case (such as 4:2:0 coding halfresolution vertically and horizontally, or 4:2:2 coding half resolutiononly horizontally). Coding effectiveness can be increased in accordancewith this aspect of the invention by applying a dynamic filter processduring motion compensation to both chroma and luminance (independentlyor in tandem), selected per image unit.

U.S. patent application Ser. No. 09/545,233, entitled “Enhanced Temporaland Resolution Layering in Advanced Television” (referenced above),describes the use of improved displacement filters having negative lobes(a truncated sinc function). These filters have the advantage that theypreserve sharpness when performing the fractional-pixel portion ofmotion vector displacement. At both the integer pixel displacement pointand at the fractional points, some macroblocks (or other useful imageregions) are more optimally displaced using filters which reduce orincrease their sharpness. For example, for a “rack focus” (where someobjects in the frame are going out of focus over time, and othersportions of the frame are coming into focus), the transition is one ofchange both in sharpness and in softness. Thus, a motion compensationfilter that can both increase sharpness at certain regions in an imagewhile decreasing sharpness in other regions can improve codingefficiency. In particular, if a region of a picture is going out offocus, it may be beneficial to decrease sharpness, which will soften theimage (thereby potentially creating a better match) and decrease grainand/or noise (thereby possibly improving coding efficiency). If a regionof the image is coming into focus, it may be beneficial to preservemaximum sharpness, or even increase sharpness using larger negative lobefilter values.

Chroma filtering can also benefit from sharpness increase and decreaseduring coding. For example, much of the coding efficiency benefits of4:2:0 coding (half resolution chroma horizontally and vertically) can beachieved by using softer motion compensation filters for chroma whilepreserving full resolution in the U and/or V channels. Only when colordetail in the U and V channels is high will it be necessary to selectthe sharpest displacement filters; softer filters will be morebeneficial where there is high color noise or grain.

In addition to changes in focus, it is also common to have the directionand amount of motion blur change from one frame to the next. At themotion picture film frame rate of 24 fps, even a simple dialog scene canhave significant changes in motion blur from one frame to the next. Forexample, an upper lip might blur in one frame, and sharpen in the next,entirely due to the motion of the lip during the open shutter time inthe camera. For such motion blur, it will be beneficial not only to havesharpening and softening (blurring) filters during motion compensation,but also to have a directional aspect to the sharpening and softening.For example, if a direction of motion can be determined, a softening orsharpening along that direction can be used to correspond to the movingor stopping of an image feature. The motion vectors used for motioncompensation can themselves provide some useful information about theamount of motion, and the change in the amount of motion (i.e., motionblur), for a particular frame (or region within a frame) with respect toany of the surrounding frames (or corresponding regions). In particular,a motion vector is the best movement match between P frames, whilemotion blur results from movement during the open shutter time within aframe.

FIG. 24 is a graph of position of an object within a frame versus time.The shutter of a camera is open only during part of a frame time. Anymotion of the object while the shutter is open results in blur. Theamount of motion blur is indicated by the amount of position changeduring the shutter open time. Thus, the slope of the position curve 2400while the shutter is open is a measurement of motion blur.

The amount of motion blur and the direction of motion can also bedetermined from a combination of sharpness metrics, surrounding motionvectors (where image regions match), feature smear detection, and humanassisted designation of frame regions. A filter can be selected based onthe determined amount of motion blur and motion direction. For example,a mapping of various filters versus determined motion blur and directioncan be empirically determined.

When combined with the other aspects of this invention, suchintelligently applied filters can significantly improve compressioncoding efficiency. A small number of such filters can be selected with asmall number of bits signaled to the decoder. Again, this can be doneonce per image unit or at other useful points in the decoding process.As with weighting sets, a dynamically loaded set of filters can be used,as well as an active subsetting mechanism, to minimize the number ofbits needed to select between the most beneficial set of filterparameters.

Implementation

The invention may be implemented in hardware or software, or acombination of both (e.g., programmable logic arrays). Unless otherwisespecified, the algorithms included as part of the invention are notinherently related to any particular computer or other apparatus. Inparticular, various general purpose machines may be used with programswritten in accordance with the teachings herein, or it may be moreconvenient to construct more specialized apparatus (e.g., integratedcircuits) to perform particular functions. Thus, the invention may beimplemented in one or more computer programs executing on one or moreprogrammable computer systems each comprising at least one processor, atleast one data storage system (including volatile and non-volatilememory and/or storage elements), at least one input device or port, andat least one output device or port. Program code is applied to inputdata to perform the functions described herein and generate outputinformation. The output information is applied to one or more outputdevices, in known fashion.

Each such program may be implemented in any desired computer language(including machine, assembly, or high level procedural, logical, orobject oriented programming languages) to communicate with a computersystem. In any case, the language may be a compiled or interpretedlanguage.

Each such computer program is preferably stored on or downloaded to astorage media or device (e.g., solid state memory or media, or magneticor optical media) readable by a general or special purpose programmablecomputer, for configuring and operating the computer when the storagemedia or device is read by the computer system to perform the proceduresdescribed herein. The inventive system may also be considered to beimplemented as a computer-readable storage medium, configured with acomputer program, where the storage medium so configured causes acomputer system to operate in a specific and predefined manner toperform the functions described herein.

A number of embodiments of the invention have been described.Nevertheless, it will be understood that various modifications may bemade without departing from the spirit and scope of the invention. Forexample, some of the steps described above may be order independent, andthus can be performed in an order different from that described.Accordingly, other embodiments are within the scope of the followingclaims.

1. A method for video image compression using direct mode prediction,including: providing a sequence of predicted and bi-directionallypredicted frames each comprising pixel values arranged in picture areas,wherein at least one of the picture areas in at least one of thebi-directionally predicted frames is predicted from picture areas in oneor more reference frames using direct mode prediction; and determining apredicted motion vector with a frame-distance method, wherein, given apredicted picture area in a first reference frame, a predicted frame ofthe predicted picture area, and a motion vector of a co-locating picturearea in a second reference frame, the predicted motion vector islinearly proportional to the motion vector and a distance between thepredicted frame of the predicted picture area and at least one of thefirst or second reference frames.
 2. The method of claim 1, furthercomprising referencing a second predicted frame from the secondreference frame by referencing the second predicted frame with thepredicted frame of the predicted picture area.
 3. The method of claim 1,further comprising associating the predicted picture area with referenceframes comprising at least one of the first reference frame or thesecond reference frame.
 4. The method of claim 1, wherein theframe-distance method comprises a function of a frame scale fraction. 5.The method of claim 4, wherein the frame scale fraction comprises anumerator and a denominator, wherein the numerator of the frame scalefraction is proportional to a first frame distance from the predictedframe of the predicted picture area to the first reference frame and thedenominator of the frame scale fraction is proportional to a secondframe distance between the first reference frame and another referenceframe referenced by the first reference frame.
 6. The method of claim 1,further comprising providing both the first and second reference framesin a display order that is prior to a display order of the predictedframe of the predicted picture area.
 7. The method of claim 1, furthercomprising providing both the first and second reference frames in adisplay order that is subsequent to a display order of the predictedframe of the predicted picture area.
 8. A method for video imagecompression using direct mode prediction, including: providing asequence of predicted and bi-directionally predicted frames eachcomprising pixel values arranged in picture areas, wherein at least oneof the picture areas in at least one of the predicted frames ispredicted from picture areas in one or more reference frames usingdirect mode prediction; and determining a predicted motion vector with aframe-distance method, wherein, given a predicted picture area in atarget reference frame and a first motion vector of a co-locatingpicture area in a second reference frame that is referenced by thetarget reference frame, the predicted motion vector is linearlyproportional to the first motion vector and a distance between apredicted frame of the predicted picture area and the target referenceframe.
 9. The method of claim 8, further comprising determining thepredicted motion vector by multiplying the first motion vector with aframe scale fraction.
 10. The method of claim 9, wherein the frame scalefraction comprises a numerator and a denominator, wherein the numeratorof the frame scale fraction is proportional to a first frame distancefrom the predicted frame of the predicted picture area to the targetreference frame, and wherein the denominator of the frame scale fractionis proportional to a second frame distance between the target referenceframe and another reference frame referenced by the target referenceframe.
 11. A decoder for video image decompression using direct modeprediction, the decoder being configured for processing instructionsincluding: providing a sequence of predicted and bi-directionallypredicted frames each comprising pixel values arranged in picture areas,wherein at least one of the picture areas in at least one of thebi-directionally predicted frames is predicted from picture areas in oneor more reference frames using direct mode prediction; and determining apredicted motion vector with a frame-distance method, wherein, given apredicted picture area in a first reference frame, a predicted frame ofthe predicted picture area, and a motion vector of a co-locating picturearea in a second reference frame, the predicted motion vector islinearly proportional to the motion vector and a distance between thepredicted frame of the predicted picture area and at least one of thefirst or second reference frames.
 12. The decoder of claim 11, thedecoder further being configured for processing instructions comprisingreferencing a second predicted frame from the second reference frame byreferencing the second predicted frame with the predicted frame of thepredicted picture area.
 13. The decoder of claim 11, the decoder furtherbeing configured for processing instructions comprising associating thepredicted picture area with reference frames comprising at least one ofthe first reference frame or the second reference frame.
 14. The decoderof claim 11, wherein the frame-distance method comprises a function of aframe scale fraction.
 15. The decoder of claim 14, wherein the framescale fraction comprises a numerator and a denominator, wherein thenumerator of the frame scale fraction is proportional to a first framedistance from the predicted frame of the predicted picture area to thefirst reference frame and the denominator of the frame scale fraction isproportional to a second frame distance between the first referenceframe and another reference frame referenced by the first referenceframe.
 16. The decoder of claim 11, the decoder further being configuredfor processing instructions comprising providing both the first andsecond reference frames in a display order that is prior to a displayorder of the predicted frame of the predicted picture area.
 17. Thedecoder of claim 11, the decoder further being configured for processinginstructions comprising providing both the first and second referenceframes in a display order that is subsequent to a display order of thepredicted frame of the predicted picture area.